<?php

class Zend_View_Helper_Popular extends Zend_View_Helper_Abstract {

    public function popular() {

        $newsmenager=new Managers\News();
        $popularnews=$newsmenager->getPopularNews();

        $news='<div><h3>Самые популярные</h3>';
        foreach ($popularnews as $one){
        $news.='<div style="margin-bottom: 10px;">';
            $news.='<img src="http://placehold.it/100x100" style="float:left;margin:0 10px 0 0; height:100px;width:100px;" >';
//            $news.='<img src="'.$one['img'].'" style="float:left;margin:0 10px 0 0; height:100px;width:100px;" >';
            $news.='<div><a href="/index/news/id/'.$one['id'].'">'.strip_tags($one['title']).'</a></div>';
            $news.='<span>Просмотров:'.$one['views'].'</span>';
            $news.='<div style="clear:both"></div>';
        $news.='</div>';
        }
        $news.='</div>';
        return $news;
    }

}
